<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="">
  <meta name="author" content="">
  <link rel="icon" th:href="@{../favicon.ico}">

  <title>员工列表</title>

  <!-- Bootstrap core CSS -->
  <link th:href="@{../css/bootstrap.min.css}" rel="stylesheet">

  <!-- Custom styles for this template -->
  <link th:href="@{../css/dashboard.css}" rel="stylesheet">
</head>



<body>

<div th:replace="~{common/commons.html::top}"></div>

<div class="container-fluid" th:fragment="sider">
  <div class="row">

    <div th:replace="~{common/commons.html::side(active = 'list.html')}"></div>
    <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">

      <div class="form-control">
        <form th:action="@{/searchStaff}" method="post">

          <div class="input-group">
            <input name="conditionText" type="text" class="form-control" placeholder="搜索要求" th:value="${conditionText}">
            <div class="input-group-append">
              <select name="conditionType" id=""  class="selected">
                <option value="任意">任意</option>
                <option value="员工id">员工id</option>
              </select>
            </div>
          </div>
          <p></p>

          <div style="float: left">
            <span>性别：</span>
            <select  id="filter-gender" name="conditionGender" class="form-control" style="width: 120px">
              <option value="任意">任意</option>
              <option value="男">男</option>
              <option value="女">女</option>
            </select>
          </div>
          <div  style="float: left">
            <span>职位：</span>
            <select name="conditionJob" class="form-control"  style="width: 120px" th:placeholder="职位">
              <option value="任意">任意</option>
              <option th:each="job:${jobs}" th:text="${job.getJobName()}" th:value="${job.getId()}"></option>
            </select>
          </div>
          <div  style="float: left">
            <span>部门：</span>
            <select name="conditionDepartment" class="form-control" style="width: 120px" th:placeholder="部门">
              <option value="任意">任意</option>
              <option th:each="dept:${deps}" th:text="${dept.getDepartmentName()}" th:value="${dept.getId()}"></option>
            </select>
          </div>
          <div style="float: right">
            <button type="submit" class="btn btn-default">搜索</button>
          </div>
        </form>


      </div>

      <p></p>
      <p></p>
      <p></p>
      <div class="form-control">

        <div class="table-responsive">
          <table class="table table-striped table-sm">
            <thead>
            <tr>
              <th>id</th>
              <th>name</th>
              <th>gender</th>
              <th>birth</th>
              <th>Phone</th>
              <th>Salary</th>
              <th>Address</th>
              <th>Department</th>
              <th>Job</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="emp:${emps}">
              <td th:text="${emp.getS_id()}"></td>
              <td th:text="${emp.getS_name()}"></td>
              <td th:text="${emp.getGender()}"></td>
              <td th:text="${emp.getBirth()}"></td>
              <td th:text="${emp.getPhone()}"></td>
              <td th:text="${emp.salary}"></td>
              <td th:text="${emp.getS_address()}"></td>
              <td th:text="${emp.department.departmentName}"></td>
              <td th:text="${emp.job.getJobName()}"></td>
              <td>
                <a class="btn btn-sm btn-primary" th:href="@{emp/{id}(id=${emp.getS_id()})}">编辑</a>
                <a class="btn btn-sm btn-danger" th:href="@{delemp/{id}(id = ${emp.getS_id()})}">删除</a>
              </td>
            </tr>
            </tbody>
          </table>
        </div>
      </div>
      <a class="btn btn-sm btn-success" th:href="@{/addemp}" style="float: right">添加员工</a>



    </main>

  </div>
</div>

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="/js/jquery-slim.min.js"><\/script>')</script>
<script src="/js/popper.min.js"></script>
<script src="/js/bootstrap.min.js"></script>

<!-- Icons -->
<script src="https://unpkg.com/feather-icons/dist/feather.min.js"></script>
<script>
  feather.replace()

</script>

</body>
</html>
